// Kony

#pragma once

#include "CoreMinimal.h"
#include "UI/WidgetController/BaseWidgetController.h"
#include "AttributeMenuWidgetController.generated.h"

class UAttributeInfo;
struct FGameplayTag;
struct FGameplayAttribute;

//广播委托结构体
struct FBaseAttributeInfo;
//广播多播委托
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAttributeInfoSignature, const FBaseAttributeInfo&, Info);

/**
 * 属性菜单 小部件控制器
 */
UCLASS(BlueprintType, Blueprintable)
class GASC_HUANLING_API UAttributeMenuWidgetController : public UBaseWidgetController
{
	GENERATED_BODY()
public:
	//重写绑定回调信息函数
	virtual void BindCallbacksToDependencies() override;
	//重写初始化值广播函数
	virtual void BroadcastInitializeValues() override;
	//重写初始化广播函数
	UPROPERTY(BlueprintAssignable,Category="GAS|Attributes")
	FAttributeInfoSignature AttributeInfoDelegate;
	//属性点变更委托
	UPROPERTY(BlueprintAssignable, Category = "GAS|Attributes")
	FOnPlayerStatChangedSignature AttributePointsChanged;
	
	//升级属性函数，调用能力系统组件执行升级属性操作
	UFUNCTION(BlueprintCallable)
	void UpgradeAttribute(const FGameplayTag& AttributeTag);
	
protected:
	//属性信息数据资产
	UPROPERTY(EditDefaultsOnly)
	TObjectPtr<UAttributeInfo> AttributeInfo;
private:
	void BroadcastAttributeInfo(const FGameplayTag& AttributeTag, const FGameplayAttribute& Attribute) const;
};
